1. Technical Field
The present disclosure pertains to the field of image outputting and, in particular, to systems and methods for optimizing performance of printing or display when outputting graphical objects.
2. Description of Related Art
Printer software is continually evolving to process higher level page description and page layout languages. Examples of higher-level languages include Open Office XML (“OOXML”), Unstructured Operation MarkupLanguage (“UOML”), and Open Document Format (“ODF”), to name just a few. While lower level languages provide specific parameters for outputting images to a printed page, higher level languages generally provide the data to the printer with looser guidelines for formatting and rendering of the data in the specified format. Therefore, in higher level languages, more calculation steps are performed to convert the high level objects, such as graphs, charts and surfaces, into more primitive graphical objects, such as points and lines, in preparation for rendering. These calculations frequently involve a large number of trigonometric and distance function calculations.
For example, FIG. 1 shows the principles of trigonometry. The sine, cosine, and tangent functions may be used to calculate a point location relative to another point location, given a distance and an angle, or two distances. For example, as shown in FIG. 1, the distance X may be obtained by calculating the product of the distance from A to B (hypotenuse of the right triangle) and the cosine of the angle C. The distance Y may be obtained by calculating the product of the distance from A to B (hypotenuse) and the sine of the angle C.
Calculating a trigonometric function (sine, cosine, or tangent) generally involves calculating several steps in a series approximation of the function. For example, a Taylor Series expansion may require 6 to 10 terms depending on the value of the angle. This can become a time consuming bottleneck and impede the performance of a printer or display device when a large number of trigonometric functions need to be calculated. Calculating a distance traditionally needs a square root calculation, which also involves a series approximation and many computations.
The conventional approach to improving the performance of printing or display devices when outputting graphics is to use lookup tables to avoid making trigonometric calculations. The sine, cosine, and/or tangent values for many different angles are calculated a priori and stored in a table. During printing or display, when a trigonometric value is needed, the output device will use the value corresponding to the angle closest to the angle desired. While this approach may reduce the number of computations performed, the resulting calculations are less precise, and lead to an unknown trade-off between resource usage and accuracy. For calculating distance, a square root table can be used in a similar fashion, with even less certainty in the trade-off between table size (resource usage) and accuracy.